package cn.jbolt.wechat.api;

import cn.jbolt.wechat.api.interceptor.WechatMpMsgInterceptor;
import cn.jbolt.wechat.common.mp.WechatMpMsgRouter;
import cn.jbolt.wechat.service.JBoltWechatConfigService;
import cn.jbolt.wechat.service.JBoltWechatReplyContentService;
import cn.jbolt.wechat.service.JBoltWechatUserService;
import cn.jbolt.wechat.service.JBoltWechatMenuEventProcesser;
import com.jfinal.aop.Before;
import com.jfinal.aop.Inject;
import com.jfinal.core.Controller;
import com.jfinal.core.Path;

/**
 * 微信公众号被动消息处理
 * 
 * @ClassName: WechatMsgController
 * @author: JFinal学院-小木 QQ：909854136
 * @date: 2019年5月14日 上午5:39:56
 */
@Path("/wechat/mp/msg")
public class JBoltWechatMpMsgController extends Controller {
	@Inject
	private JBoltWechatConfigService wechatConfigService;
	@Inject
	private JBoltWechatReplyContentService wechatReplyContentService;
	@Inject
	private JBoltWechatMenuEventProcesser wechatMenuEventProcesser;
	@Inject
	private JBoltWechatUserService wechatUserService;

	@Before(WechatMpMsgInterceptor.class)
	public void index() {


		// 将WxXmlMessage交给消息路由器
		String res = WechatMpMsgRouter.me.route(getRequest());

		renderText(res,"text/xml");
	}




}
